package com.lagou.provider.impl;

import com.lagou.provider.HelloService;
import java.util.Random;
import org.apache.dubbo.config.annotation.Service;


@Service
public class HelloServiceImpl implements HelloService {

  private Random random = new Random();

  @Override
  public String methodA() {
    int randomNumber = random.nextInt(100);
    try {
      Thread.sleep(randomNumber);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("调用methodA,休眠毫秒数:" + randomNumber);
    return String.valueOf(randomNumber);
  }

  @Override
  public String methodB() {
    int randomNumber = random.nextInt(100);
    try {
      Thread.sleep(randomNumber);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("调用methodB,休眠毫秒数:" + randomNumber);
    return String.valueOf(randomNumber);
  }

  @Override
  public String methodC() {
    int randomNumber = random.nextInt(100);
    try {
      Thread.sleep(randomNumber);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("调用methodC,休眠毫秒数:" + randomNumber);
    return String.valueOf(randomNumber);
  }
}
